<form id="form_contactlog_showedit" method="post" action="y.php?r=contactlog/savedata">
    <input type="hidden" name="contactlog_id" value="">
    <table class="tab_form">
        <tr>
            <td><input class="easyui-textbox" name="title"  data-options="label:'主题:',required:true"></td>
            <td><input class="easyui-textbox" name="customer"
                       data-options="label:'客户:'">
            </td>
            <td><select class="easyui-combobox" name="contact_type" label="联系类型" >
                    <option value="无">无</option>
                    <option value="拜访客户">拜访客户</option>
                    <option value="联系小计">联系小计</option>
                    <option value="寄样品">寄样品</option>
                    <option value="询价">询价</option>
                    <option value="发报价">发报价</option>
                    <option value="发订单">发订单</option>
                    <option value="发货">发货</option>
                    <option value="商机转客户">商机转客户</option>
                </select></td>
        </tr>
        <tr>
            <td><select class="easyui-combobox" name="status" label="状态" >
                    <option value="无">无</option>
                    <option value="潜在">潜在</option>
                    <option value="有意向">有意向</option>
                    <option value="失败">失败</option>
                    <option value="已成交">已成交</option>
                </select></td>
            <td colspan="2"></td>
        </tr>
    </table>
</form>
<div style="text-align:center;padding:5px 0">
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">保存</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">清空</a>
</div>
<script>
    var dataobj = <?php echo json_encode($contactlog) ?>;
    $(function () {
        $('#form_contactlog_showedit').form('load', dataobj);
    });
    function submitForm() {
        $('#form_contactlog_showedit').form('submit', {
            success: function () {
                $('#win_main').window("close");
                $("#contactlog_list").datagrid("reload");
            }
        });
    }
    function clearForm() {
        $('#form_contactlog_showedit').form('clear');
        if (dataobj != null) {
            $("input[name=contactlog_id]").val(dataobj.contactlog_id);
        }
    }
</script>